package towerDefense;

/**
 * Class to describe the basic monster in the game world. Will eventually deprecated for
 * a defined creature type. 
 * 
 * @author Guillermo Mendez-Kestler
 *
 */
public class Enemy_Basic extends T_Enemy implements I_Enemy {

	/**
	 * The size of the bounding box for the enemy on the game world. Current
	 * size is {@value}.
	 */
	private static final double ENEMY_SIZE = 3;

	/**
	 * The amount of health the enemy begins with. This enemy type starts 
	 * with {@value} health. 
	 */
	private static final int STARTING_LIFE_POINTS = 300;
	
	/**
	 * Current amount of life points the enemy has. 
	 */
	private int LIFE_POINTS;

	/**
	 * Default basic enemy constructor. 
	 */
	public Enemy_Basic() {
		super (Constants.ENEMY_1);
		World.addT_Enemy(this);
		LIFE_POINTS=STARTING_LIFE_POINTS;
	}

	/**
	 * Basic enemy constructor. All that are needed is the center of the 
	 * enemy to begin its march. 
	 * 
	 * @param x_coord X Starting Coord
	 * @param y_coord Y Starting Coord
	 */
	public Enemy_Basic(double x_coord, double y_coord) {
		super(x_coord, y_coord, ENEMY_SIZE, Constants.ENEMY_1);
		World.addT_Enemy(this);
		LIFE_POINTS=STARTING_LIFE_POINTS;
	}

	/**
	 * Deletes the life points on the enemy. If the life points of the 
	 * enemy reaches zero (0) or less. The enemy is removed from the 
	 * world. This can return {@code false} if the enemy doesn't exist
	 * in the game world to be deleted. 
	 * 
	 * @param deduction The number of life points to remove from the 
	 * enemy. 
	 * @return {@code True} if the deduction kills the enemy, otherwise
	 * the damage amount is removed from the enemies life points.  
	 */
	public boolean deductLifePoints(int deduction) {
		LIFE_POINTS -= deduction;
		if (LIFE_POINTS<=0) {
			return World.removeEnemy(this);
		}
		else return false;
	}

	/**
	 * Returns the remainign life points on this enemy. 
	 * 
	 * @return The life points remining on this enemy. 
	 */
	public int getLifePoints() {
		return LIFE_POINTS;
	}

	/*
	 * (non-Javadoc)
	 * @see myTowerDefense.T_Enemy#changeHeading(double, double)
	 */
	public boolean changeHeading(double x_coord, double y_coord){
		return false;
	}

	/*
	 * (non-Javadoc)
	 * @see myTowerDefense.T_Enemy#changeHeading(double)
	 */
	public boolean changeHeading(double newHeading){
		return false;
	}

}
